//导入request.js请求工具
import request from '@/utils/request.js'
// import { useTokenStore } from '@/stores/token.js'
//文章分类列表查询
export const articleCategoryListService = () =>{
   // const tokenStore=useTokenStore();
    //在pinia中定义的响应式数据，都不需要使用.value来获取
    //return request.get('/category',{headers:{'Authorization':tokenStore.token}})
    return request.get('/category')
}

//文章分类添加
export const articleCategoryAddService = (categoryDate) =>{
    return request.post('/category',categoryDate)
}

//文章分类修改
export const articleCategoryUpdateService = (categoryDate) =>{
    return request.put('/category',categoryDate)
}

//文章分类删除
export const articleCategoryDeleteService = (id) =>{
    return request.delete('/category/?id='+id)
}

//文章列表查询
export const articleListService = (params) =>{
    return request.get('/article',{params:params})
}

//文章添加
export const articleAddService = (articleDate) =>{
    return request.post('/article',articleDate)
}